package control;

import java.awt.event.ActionEvent;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.JComboBox;

import vista.VentanaPrincipal;
import model.ModeloObsrvable;

public class ControladorDeslizables extends Controlador implements ItemListener{
	
	public JComboBox<String> sexo, cabello, hobby, senia, vehiculo;
	public ControladorDeslizables(VentanaPrincipal ventanaPrincipal, ModeloObsrvable modeloDelJuego) {
		super(ventanaPrincipal, modeloDelJuego);
	}
	
	@Override
	public void itemStateChanged(ItemEvent arg0) {
		getLadrones();
		modelo.notifyObservers();
		
	}
	
	@Override
	public void actionPerformed(ActionEvent arg0) {
		//getLadrones();
		//modelo.notifyObservers();
	}
	
	public void setearDesplegables(JComboBox<String> sexo, JComboBox<String> cabello, JComboBox<String> hobby, JComboBox<String> senia, JComboBox<String> vehiculo){
		this.sexo = sexo;
		this.cabello = cabello;
		this.hobby = hobby;
		this.senia = senia;
		this.vehiculo = vehiculo;
	}

	public void getLadrones() {
		String sexoElegido = (String) sexo.getSelectedItem();
		
		String cabelloElegido = (String) cabello.getSelectedItem();
		
		String hobbyElegido = (String) hobby.getSelectedItem();
		
		String seniaElegido = (String) senia.getSelectedItem();

		String vehiculoElegido = (String) vehiculo.getSelectedItem();
		
		modelo.filtrarLadronesSospechosos(sexoElegido, cabelloElegido, hobbyElegido, seniaElegido, vehiculoElegido);

}




	

}
